<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class RechargePackage extends Model
{
	use HasDateTimeFormatter;
    protected $table = 'recharge_package';

    public function recharge_type()
    {
        return $this->belongsTo(RechargeType::class);
    }

    public function operator()
    {
        return $this->belongsTo(Operator::class);
    }

    public function setMoneyAttribute($money) {
        $this->attributes['money']= (int) ($money * 1000);
    }

    public function setMoneyTaxAttribute($money_tax) {
        $this->attributes['money_tax']= (int) ($money_tax * 1000);
    }

}
